<?php

include_once APPLICATION_PATH . '/forms/AbmClientesForm.php';

class IndexController extends Zend_Controller_Action
{

//    public function preDispatch()
//    {
//        $request = $this->getRequest();
//
//        Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
//        $contextSwitch = $this->_helper->contextSwitch;
//        if (!$contextSwitch->hasContext('ajax')) {
//            $contextSwitch->addContext('ajax', array('suffix' => 'ajax'))
//                        ->addActionContext('new', 'ajax')
//                        ->addActionContext('followup', 'ajax')
//                        ->addActionContext('display', 'ajax')
//                        ->addActionContext('active', 'ajax')
//                        ->addActionContext('active-data', 'ajax')
//                        ->addActionContext('active-data-count', 'ajax')
//                        ->initContext();
//        }
//
//        $message = array(
//            'Current request information',
//            array(
//                array('Module', 'Controller', 'Action'),
//                array($request->getModuleName(), $request->getControllerName(), $request->getActionName()),
//            )
//        );
//
//        Zend_Registry::get('log')->table($message);
//    }

    function getForm() {
        return new AbmClientesForm();
    }

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        $this->_helper->layout()->setLayoutPath('../layouts/scripts');
        $this->_helper->layout()->setLayout('layout');
        $form = $this->getForm();
        $this->view->form = $form;

        if (!$this->getRequest()->isPost())
        {
            return;
        }
        if (!$form->isValid($_POST))
        {
            return;
        }

        $values = $form->getValues();

        {
            $this->view->message = "test";
        }
    }


}

